Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

383
Visualizações
"npm start" shows "Unhandled promise rejection" error

I am new to NodeJS and NPM.

When I run npm start within a NodeJS project, the following errors occurred:

Starting the development server...

(node:9417) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with code 3

What does this error mean? How should debug this problem?

$ grep start package.json 
    "start": "react-scripts start",

$ npm -v
3.10.10
$ node -v
v6.10.1

$ npm ls react-scripts
reference-apps@2.3.1 /home/li/sample
└── react-scripts@0.5.1  
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I guess your code like below

new Promise(function(resolve, reject){
    reject(0)
}).then()

when you run the code above, you will get “Unhandled promise rejection”.

with Promise/A+ standard #point-21. A promise must provide a then method to access its current or eventual value or reason.

you'd better write code as below

promise.then(onFulfilled, onRejected)

the other way to avoid the issue, you can listen the unhandledRejection event with process

process.on('unhandledRejection', (reason, p) => {
  console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
  // application specific logging, throwing an error, or other logic here
});  
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda